// ==UserScript==
// @name         Expand Jenkins matrix label
// @namespace    https://gitee.com/amadeus666/tampermonkey-scripts/tree/master
// @version      1.0
// @description  Expand Jenkins matrix label
// @author       wz
// ==/UserScript==

(function() {
    'use strict';

    function disableMaxWidthInMatrixDivs() {
        const divElements = document.querySelectorAll('div[title*="Matrix"]');

        for (const divElement of divElements) {
            divElement.style.maxWidth = "500px";
            divElement.style.left = "0px";
        }
    }

    function applyDisableMaxWidth() {
        disableMaxWidthInMatrixDivs();
        setTimeout(applyDisableMaxWidth, 5000);
        console.log("haha");
    }

    // Wait for the window.onload event
    window.onload = function() {
        disableMaxWidthInMatrixDivs();
        applyDisableMaxWidth();
    };
})();